//
//  Student_infoVC.m
//  teaching
//
//  Created by yishangpin2 on 15/5/9.
//  Copyright (c) 2015年 衣尚品1. All rights reserved.
//

#import "Student_infoVC.h"

@interface Student_infoVC (){
    UIAlertView *alert1;

}

@end

@implementation Student_infoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.pic.layer.masksToBounds = YES;
    self.pic.layer.cornerRadius = 66 ;
    
    [UIView animateWithDuration:0.1 animations:^{
        [self.view layoutIfNeeded];
    }];
    
    
    [self SetUpStar];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - 星星代码显示
-(void)SetUpStar{
    
    TQStarRatingView *starRatingView = [[TQStarRatingView alloc] initWithFrame:CGRectMake(174, 128, 104, 21) numberOfStar:5];
    
//    此方法一旦调用，评分就不可变
    [starRatingView StarScore:0.9];
    
    
    starRatingView.delegate = self;
    
    [self.view addSubview:starRatingView];
    
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)hello:(id)sender {
    
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello" message:@"是否向该学生打招呼？" delegate:self cancelButtonTitle:@"否" otherButtonTitles:@"是", nil];
    [alert show];

}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

    if(buttonIndex == 1){
    
        alert1 = [[UIAlertView alloc] initWithTitle:@"" message:@"  ╰(￣▽￣)╮  招呼已发送给该学生,您只需耐心等待她的消息回复" delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
        [alert1 show];
        
        
        //延迟6秒执行 animation 方法
        [self performSelector:@selector(dismiss) withObject:nil afterDelay:4.0f];

        
    }


}

-(void)dismiss{


    [alert1 dismissWithClickedButtonIndex:0 animated:YES];

}

@end
